@extends('Admin.layout.layout')
@section('title','添加药材')
@section('home','药材管理')
@section('weizhi','添加药材')
@section('con')

<div class="panel-body">
  <div class="form">
      <form class="form-validate form-horizontal" id="feedback_form" method="post" action="/admin/medicinal/insert" enctype="multipart/form-data" novalidate="novalidate">
          <div class="form-group ">
              <label for="cname" class="control-label col-lg-2">药材名称<span class="required">*</span></label>
              <div class="col-lg-10" style="width: 300px;">
                  <input class="form-control" id="cname" name="name" minlength="5" type="text" required="">
              </div>
          </div>
          <div class="form-group ">
              <label for="cemail" class="control-label col-lg-2">英文名<span class="required">*</span></label>
              <div class="col-lg-10" style="width: 300px;">
                  <input class="form-control " id="cemail" type="text" name="ename" required="">
              </div>
          </div>
          <div class="form-group ">
              <label for="ccomment" class="control-label col-lg-2">所属店铺<span class="required">*</span></label>
              <div class="col-lg-10" style="width: 300px;">
                   <input class="form-control" id="subject" name="sid" minlength="5" type="text" required="">
              </div>
          </div>
          <div class="form-group ">
              <label for="curl" class="control-label col-lg-2">药材属性<span class="required">*</span></label>
              <div class="col-lg-10" style="width: 300px;">
                  <input class="form-control " id="curl" type="text" name="properties">
              </div>
          </div>
          <div class="form-group ">
              <label for="cname" class="control-label col-lg-2">价格 <span class="required">*</span></label>
              <div class="col-lg-10" style="width: 300px;">
                  <input class="form-control" id="subject" name="price" minlength="5" type="text" required="">
              </div>
          </div>                                      
          <div class="form-group ">
              <label for="ccomment" class="control-label col-lg-2">药材类别<span class="required">*</span></label>
              <div class="col-lg-10" style="width: 300px;">
                   <input class="form-control" id="subject" name="tid" minlength="5" type="text" required="">
              </div>
          </div>
          <div class="form-group ">
              <label for="ccomment" class="control-label col-lg-2">药材产地<span class="required">*</span></label>
              <div class="col-lg-10" style="width: 300px;">
                   <input class="form-control" id="subject" name="mAddress" minlength="5" type="text" required="">
              </div>
          </div>
          <div class="form-group ">
              <label for="ccomment" class="control-label col-lg-2">药材库存地<span class="required">*</span></label>
              <div class="col-lg-10" style="width: 300px;">
                   <input class="form-control" id="subject" name="mStickAddre" minlength="5" type="text" required="">
              </div>
          </div>
          <div class="form-group ">
              <label for="ccomment" class="control-label col-lg-2">药材销量<span class="required">*</span></label>
              <div class="col-lg-10" style="width: 300px;">
                   <input class="form-control" id="subject" name="sales" minlength="5" type="text" required="">
              </div>
          </div>
          <div class="form-group ">
              <label for="ccomment" class="control-label col-lg-2">药材库存<span class="required">*</span></label>
              <div class="col-lg-10" style="width: 300px;">
                   <input class="form-control" id="subject" name="stock" minlength="5" type="text" required="">
              </div>
          </div>
          <div class="form-group ">
              <label for="ccomment" class="control-label col-lg-2">药材单位<span class="required">*</span></label>
              <div class="col-lg-10" style="width: 300px;">
                   <input class="form-control" id="subject" name="company" minlength="5" type="text" required="">
              </div>
          </div>
          <div class="form-group ">
              <label for="ccomment" class="control-label col-lg-2">药材生产日期<span class="required">*</span></label>
              <div class="col-lg-10" style="width: 300px;">
                   <input class="form-control" id="subject" name="production" minlength="5" type="text" required="">
              </div>
          </div>
          <div class="form-group ">
              <label for="ccomment" class="control-label col-lg-2">药材有效期<span class="required">*</span></label>
              <div class="col-lg-10" style="width: 300px;">
                   <input class="form-control" id="subject" name="mTime" minlength="5" type="text" required="">
              </div>
          </div>
<!--           <div id="m_img">
            <div id="image-holder">
              
            </div>
          </div> -->
          <div class="form-group ">
              <label for="ccomment" class="control-label col-lg-2">药材图<span class="required">*</span></label>
              <div class="col-lg-10" style="width: 300px;">
                   <input name="mimg" type="file" id="fileUpload">
              </div>
              <p class="help-block">最大不超过2MB</p>
          </div>
          <!-- <div class="form-group">
              <label for="exampleInputFile"><font><font>药材图</font></font></label>
              <input type="file" id="exampleInputFile">
          </div> -->
          {{csrf_field()}}
          <div class="form-group">
              <div class="col-lg-offset-2 col-lg-10">
                  <button class="btn btn-primary" type="submit">提交</button>
                  <button class="btn btn-default" type="button">取消</button>
              </div>
          </div>
      </form>
  </div>

</div>

<!-- 上传文件判断 -->
<script type="text/javascript">
//     $("fileUpload").on('change',function(){
//         if(typeof(FileReader) != "undefined"){
//           var image_holeder = #("image_holder");
//           image_holder.empty();

//           var reader = new FileReader();
//           reader.onload = function(e){
//             $("<img/>",{
//               "src":e.target.result,
//               "class":"cover_small"
//             }).appendTo(image_holder);
//           };
//         image_holder.show();
//         reader.readA sDataURL($(this)[0].files[0]);
//         }else{
//           alert('你的浏览器不支持');
//         }
//     });

</script>


@endsection